package pl.edu.agh.thieves.cuckoo;

import java.util.ArrayList;
import java.util.Collection;

import pl.edu.agh.thieves.common.Item;
import pl.edu.agh.thieves.common.Iteration;
import pl.edu.agh.thieves.common.OptimalSolution;

public class OptimalSolutionCuckoo implements OptimalSolution {

	private ArrayList<Item> items;
	private ArrayList<Iteration> iterations;
	private int bestIteration;
	private long timeOfAll;
	private long bestTime;

	public OptimalSolutionCuckoo() {
		items = new ArrayList<Item>();
		timeOfAll = 0;
		bestTime = 0;
		bestIteration=0;
		iterations= new ArrayList<Iteration>();
	}

	public OptimalSolutionCuckoo(Collection<Item> items, int iteration,
			long bestResultTime, long timeOfAllIterations,
			Collection<Iteration> iterations) {
		this.items = new ArrayList<Item>();
		timeOfAll = timeOfAllIterations;
		bestTime = bestResultTime;
		bestIteration=iteration;
		this.iterations= new ArrayList<Iteration>();
		
		this.items.addAll(items);
		this.iterations.addAll(iterations);
		
	}

	@Override
	public void setItems(ArrayList<Item> items) {
		// TODO Auto-generated method stub
		this.items.addAll(items);

	}

	@Override
	public ArrayList<Item> getItems() {
		// TODO Auto-generated method stub
		return items;
	}

	@Override
	public void setTimeOfAll(long time) {
		timeOfAll = time;
		// TODO Auto-generated method stub

	}

	@Override
	public long getTimeOfAll() {
		// TODO Auto-generated method stub
		return timeOfAll;
	}

	@Override
	public void setTimeUntilBestIteration(long time) {
		bestTime = time;
		// TODO Auto-generated method stub

	}

	@Override
	public long getTimeUntilBestIteration() {
		// TODO Auto-generated method stub
		return bestTime;
	}

	@Override
	public void setListOfAllIterations(ArrayList<Iteration> iterations) {
		// TODO Auto-generated method stub
		this.iterations.addAll(iterations);

	}

	@Override
	public ArrayList<Iteration> getListOfAllIterations() {
		// TODO Auto-generated method stub
		return iterations;
	}

	@Override
	public void setNumberOfBestIteration(int iteration) {
		// TODO Auto-generated method stub
		bestIteration=iteration;

	}

	@Override
	public int getNumberOfBestIteration() {
		// TODO Auto-generated method stub
		return bestIteration;
	}

}
